Skip to content

feat(java): detect doCheck* file-capability probes without a permission check (CWE-200) - #110

Open
ai-anant wants to merge 1 commit into
CodeVigilant:mainfrom
ai-anant:rule/docheck-file-capability-probes
Open

feat(java): detect doCheck* file-capability probes without a permission check (CWE-200)#110
ai-anant wants to merge 1 commit into
CodeVigilant:mainfrom
ai-anant:rule/docheck-file-capability-probes

Conversation

@ai-anant

Copy link
Copy Markdown

New rule: Stapler form-validation handlers (doCheck*) that build a java.io.File from handler input and then probe file capabilities (canRead/canWrite/canExecute/isFile/isDirectory/length/listFiles) without an explicit ACL permission check.

Descriptor doCheck* methods are routed directly by Stapler and are not protected by any permission by default, so any user who can reach the descriptor URL can use such an endpoint as a file-capability oracle for arbitrary paths on the controller. Complements the existing exists()-probe rule with the remaining capability-probe sink methods. Handlers guarded by checkPermission(...) are excluded.

Positive and negative testcases included under testcases/java/. Validated with semgrep 1.172 (pos fires, neg clean).

…canExecute/isFile/isDirectory/length) without a permission check (CWE-200)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant